
/************
Ten tac gia : Ly Thien kim
Ngay tao : 8/16/2011
Noi dung : Delete 1 SYS_USER
************/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE NAME = 'sp_DeleteSYS_USER')
BEGIN
	DROP PROC sp_DeleteSYS_USER
END
GO
CREATE PROC sp_DeleteSYS_USER
	@ID					int,
	@IDROLE				int,
	@Result				int out
	AS
	BEGIN
		IF EXISTS (SELECT * FROM SYS_USER WHERE  @ID = ID and @IDROLE = IDROLE)
		BEGIN
			DELETE FROM SYS_USER
			WHERE @ID = ID and @IDROLE = @IDROLE
			SET @RESULT = 1
		END
		ELSE 
		BEGIN
			SET @RESULT = 0
		END
	END
